package javaCode;

import sun.font.EAttribute;

public class LeetCode492 {
	 public int[] constructRectangle(int area) {
	        int L = 0;
	        int W = 0;
	        int[] nums = {L,W};
	        L = W = (int)Math.sqrt(area);
	        int temp = L*W;
	        while(temp != area){
	        	if(temp < area){
	        		L++;
	        	}else{
	        		W--;
	        	}
	        	temp = L*W;
	        	
	        }
	        nums[0] = L;
	        nums[1] = W;
//	        System.out.println(L+":"+W);
	        return nums;
	        
	        
	    }
}
